def is_additive_number(num: str) -> bool:
    def dfs(remaining, first, second):
        if not remaining:
            return True
        total = first + second
        total_str = str(total)
        if remaining.startswith(total_str):
            return dfs(remaining[len(total_str):], second, total)
        return False

    n = len(num)
    for i in range(1, n):
        for j in range(i + 1, n):
            if num[0] == '0' and i > 1:
                break
            if num[i] == '0' and j - i > 1:
                continue
            first = int(num[:i])
            second = int(num[i:j])
            if dfs(num[j:], first, second):
                return True
    return False
